import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

import index from "../pages/index.vue"
import detail from "../pages/detail.vue"
import list from "../pages/list.vue"

const router = new VueRouter({
  routes:[
    //#/ 首页
    {
      path:"/",
      component:index
    },
    {
      path:"/index",
      component:index
    },
    {
      path:"/detail",
      component:detail
    },
    {
      path:"/list",
      component:list
    },
    //路由的重定向，如果前面没有匹配到的路径，就执行重定向，重新指向路径
    {
      path:"*",
      redirect:"/index"
    }
  ]
})

export default router
